<html>
<head>
    <title>XBRLAPI.ORG XBRL Report Rendering Example</title>
    <link rel="stylesheet" href="/css/styles.css" type="text/css"/>
    <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
        try {
            var pageTracker = _gat._getTracker("UA-11401995-1");
            pageTracker._setDomainName("none");
            pageTracker._setAllowLinker(true);
            pageTracker._trackPageview();
        } catch (err) {
        }</script>
</head>


<body>

<div class="logo_container">
	<span class="logo">
		<a class="title" href="/">XBRLAPI</a>
	</span>
	<span class="logo_subscript">
		<a class="title" href="http://en.wikipedia.org/wiki/Free_and_open_source_software">Free Open-Source Software</a>
	</span>
</div>

<div id="navcontainer">
    <form action="http://www.xbrlapi.org/search.html" id="cse-search-box">
        <div>
            <input type="hidden" name="cx" value="partner-pub-3957505011939955:jqid48zd81o"/>
            <input type="hidden" name="cof" value="FORID:10"/>
            <input type="hidden" name="ie" value="ISO-8859-1"/>
            <input type="text" name="q" size="31"/>
            <input type="submit" name="sa" value="Search"/>
        </div>
    </form>

    <script
            type="text/javascript"
            src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en">
    </script>

    <ul id="navlist">
        <li><a href="/">Home</a></li>
        <li><a href="..">Examples</a></li>
    </ul>

    <script type="text/javascript"><!--
    google_ad_client = "pub-3957505011939955";
    /* XBRLAPI site */
    google_ad_slot = "4927123290";
    google_ad_width = 160;
    google_ad_height = 600;
    //-->
    </script>
    <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

</div>

<div class="content">

    <h1>
        XBRLAPI rendering sample application
    </h1>

    <h2>
        Author: Steve Yang (steve2yang at yahoo.com)
    </h2>

    <h2>
        Contributor: Geoff Shuetrim (geoff at galexy.net)
    </h2>

    <h2>
        What is it?
    </h2>

    <p>
        This is a sample Java application demonstrating the usage of
        XBRLAPI and its various modules. The Rendering Sample Application loads instance
        document using XBRLAPI and renders the document according to XBRL Inline
        Specification 0.64.
    </p>

    <p>
        The purpose of this module is to give developers step by step instructions
        to discover a taxonomy set and use the XBRLAPI to store the instance
        documents and traverse through the various presentation networks to build rendering
        solutions. This sample application also demonstrates how to build XBRL Inline
        documents using XBRL API.
    </p>

    <p>
        The example uses the open source <a href="http://freemarker.sourceforge.net/">Freemarker template system</a>
        to simplify the documentation of
        the desired rendering of the information in the XBRL instance
        being processed.
    </p>

    <p>
        <a href="result.xhtml">The rendered output</a> that can be produced
        from this
        <a href="template.ftl">Freemarker template defining the report rendering</a>
        and this
        <a href="http://xbrl.us/us-gaap/instance/1.0/mmm-20071231/mmm-20071231_XML.xml">target XBRL instance</a>
        with a
        <a href="http://xbrl.us/us-gaap/instance/1.0/mmm-20071231/mmm-20071231_pre.xml">presentation linkbase</a>
        included as an additional URL starting point for DTS discovery.
        Note that the example rendering only shows the rendered output from a single presentation network. Running the
        example in full creates a significantly larger report rendering.
    </p>

    <h2>
        Where is it?
    </h2>

    <p>
        The home page for the XBRL API project can be found on the XBRLAPI
        project web site (http://www.xbrlapi.org/). There you also find
        information on how to download the latest release as well as all the other
        information you might need regarding this project.
    </p>

    <p>
        You can browse the <a
            href="http://xbrlapi.svn.sourceforge.net/viewvc/xbrlapi/trunk/module-examples/src/main/java/org/xbrlapi/data/bdbxml/examples/render/Run.java?view=log">source
        code in SVN</a>.
    </p>

    <h2>
        Requirements
    </h2>

    <ul>
        <li> A Java 1.5 or later compatible virtual machine for your operating system.</li>
        <li> Xerces 2.6.2 or later version jar file.</li>
        <li> Saxon 9.0 or later version jar file.</li>
        <li> Saxon DOM 9.0 or later version jar file.</li>
        <li> Saxon S9API 9.0 or later version jar file.</li>
        <li> Log4j 1.2.15 or later version jar file.</li>
        <li> Freemarker 2.3.14 or later version jar file.</li>
        <li> XBRLAPI module-examples jar file.</li>
        <li> XBRLAPI module-utilities jar file.</li>
        <li> XBRLAPI module-xmlbase jar file.</li>
        <li> XBRLAPI module-xlink jar file.</li>
        <li> XBRLAPI module-xpointer jar file.</li>
        <li> XBRLAPI module-api jar file.</li>
        <li> XBRLAPI module-bdb-xml jar file.</li>
        <li> A working installation of the <a href="/installationDocumentation/bdbxml.html">Oracle Berkeley XML
            Database</a>.
        </li>
    </ul>

    <p>
        You can download the required XBRLAPI JARs from
        <a href="http://sourceforge.net/projects/xbrlapi/files/">Sourceforge</a>.
        You can get suggestions on necessary installation and configuration steps
        from <a href="/">http://www.xbrlapi.org/</a>.
    </p>

    <p>
        You can get the other jar files from <a
            href="http://xbrlapi.svn.sourceforge.net/viewvc/xbrlapi/trunk/java/lib/">the XBRLAPI SVN repository</a>.
    </p>

    <h2>
        Commandline Arguments:
    </h2>

    <h3>
        Java Virtual Machine (JVM) Arguments:
    </h3>

<pre>  
  -Dlog4j.configuration=&lt;location of log4j.properties&gt;
  -Djava.library.path=&lt;Berkeley DB XML 2.5.16/lib&gt;
  -classpath=&lt;java class paths&gt;
</pre>

    <p>
        Setting up the classpath can be nightmare in Java. If you are using the Sun Java 1.6 binaries, then it is worth
        taking a
        look at the <a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html">Sun classpath
        instructions</a>.
        If those are not giving you joy, then take a look at two blogs
        (<a href="http://coding.derkeiler.com/Archive/Java/comp.lang.java.programmer/2008-12/msg00878.html">dirkeiler</a>
        and
        <a href="http://blogs.sun.com/mr/entry/class_path_wildcards_in_mustang">Mark Reinhold’s Blog</a>). These discuss
        issues with getting the <code>-classpath</code> parameter working with wildcards.

    </p>

    <h3>
        Program execution involves:
    </h3>

<pre>
  java &lt;JVM ARGUMENTS&gt; org.xbrlapi.data.bdbxml.examples.render.Run &lt;OPTIONS&gt; &lt;URLS&gt;
</pre>

    <p>
        Where the URLs are the URLs of additional starting points for DTS discovery and
        the mandatory options are:
    </p>

    <ul>
        <li>-database [the directory that will hold the actual database data (rather than the Oracle Berkeley XML
            database binaries)]
        </li>
        <li>-container [the name of the file in the -database directory that will contain the data]</li>
        <li>-cache [the directory containing the document cache]</li>
        <li>-template [the file location of the Freemarker template]*</li>
        <li>-target [the URL of the XBRL instance to be rendered]</li>
        <li>-output [the output file to produce]</li>
        <li></li>
    </ul>

    <p>
        * MS Windows issue: for reasons that remain unknown, the rendering example can have trouble loading Freemarker
        templates
        if they are located in the root directory of a MS Windows drive. Thus, a template location of <code>C:\template.ftl</code>
        will fail while a location <code>C:\templates.template.ftl</code> will work.
    </p>

    <h2>
        Licensing and legal issues
    </h2>

    <p>
        XBRLAPI examples are released under the lesser GPL license.
    </p>

    <p>
        <a href="http://sourceforge.net/projects/xbrlapi"><img
                src="http://sflogo.sourceforge.net/sflogo.php?group_id=135539&type=11" width="120" height="30"
                border="0"
                alt="Get Java XBRL API implementation at SourceForge.net. Fast, secure and Free Open Source software downloads"/></a>
    </p>

</div>

</body>
</html>
